<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <title>标签管理 - {{.SITE_NAME}}</title>
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="/static/css/main.css?version={{$.Version}}" rel="stylesheet">
    <script src="/static/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="/static/respond.js/1.4.2/respond.min.js"></script>
    <link rel="stylesheet" href="/static/css/toast.css">
    <style>.labels .btn-group{margin-right: 5px;margin-bottom: 10px;}</style>
    <style>.labels .btn-group .ajax-get{color: #ccc}</style>
    <style>.labels .btn-group .ajax-get:hover{color: #000}</style>
</head>
<body>
<div class="manual-reader">
    {{template "widgets/header.html" .}}
    <div class="container manual-body">
        <div class="row">
            <div class="page-left">
                {{template "manager/menu.html" .}}
            </div>
            <div class="page-right">
                <div class="m-box">
                    <div class="box-head">
                        <strong class="box-title">标签管理</strong>
                        <span class="text-muted">共 <span class="text-success">{{.Total}}</span> 个标签</span>
                        <a href="JavaScript:void(0);" class="pull-right btn btn-success" data-toggle="modal" data-target="#addTagsModal">新增标签</a>
                    </div>
                </div>
                <div class="box-body" id="bookList">
                    <div class="row">
                        {{if gt .Total 0}}
                            <div class="col-12 col-sm-6">
                                <form class="form-inline" action="{{urlfor "ManagerController.Tags"}}"  role="form" style="margin-bottom: 15px;">
                                    <div class="form-group">
                                        <input type="text" class="form-control" value="{{.Wd}}" name="wd" placeholder="搜索标签">
                                    </div>
                                    <button type="submit" class="btn btn-default">搜索</button>
                                </form>
                            </div>
                        {{end}}
                        <div class="col-xs-12 labels">
                            {{range .Tags}}
                                <div class="btn-group btn-group-sm rm-ajax-get" role="group">
                                    <a href="{{urlfor "SearchController.Result"}}?wd={{.LabelName}}" class="btn btn-default" target="_blank">{{.LabelName}}</a>
                                    <a href="{{urlfor "ManagerController.DelTags"}}?id={{.LabelId}}" class="btn btn-default ajax-get" title="删除">X</a>
                                </div>
                            {{end}}
                        </div>
                    </div>
                    <nav class="pagination-container">
                        {{.PageHtml}}
                    </nav>
                </div>
            </div>
        </div>
    </div>
    <!-- {{template "widgets/footer.html" .}} -->
</div>

<div class="modal fade" id="addTagsModal" tabindex="-1" role="dialog" aria-labelledby="addTagsModalLabel">
    <div class="modal-dialog" role="document">
        <form method="post" autocomplete="off" class="form-horizontal ajax-form" action="{{urlfor "ManagerController.AddTags"}}" id="addTagsModalForm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">新增标签</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label class="col-sm-12">标签名称<span class="error-message">*</span></label>
                    <div class="col-sm-12">
                        <textarea name="tags" rows="5" class="form-control" ></textarea>
                        <div class="help-block">多个标签，请换行输入或以英文逗号分隔</div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="modal-footer">
                <span id="form-error-message"></span>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="submit" class="btn btn-success" data-loading-text="添加中..." id="btnCreateCategory">新增</button>
            </div>
        </div>
        </form>
    </div>
</div><!--END Modal-->



{{/*<script src="/static/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>*/}}
<script src="/static/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>
{{/*<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>*/}}
<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="{{$.StaticDomain}}/static/js/toast.script.js"></script>
<script src="/static/js/main.js?version={{$.Version}}" type="text/javascript"></script>
</body>
</html>